<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 2.2 设置容器宽高 */
        .box{
            width: 400px;
            height: 400px;
            background-color: #bfa;
        }
    </style>
    <!-- 1.先引入ECharts.min.js文件 -->
    <script src="./js/ECharts.min.js"></script>
</head>
<body>
    <!-- 2.1创建一个用css设定了宽高的DOM容器 -->
    <div class="box"></div>
    
    <script>
        //3.初始化echarts实例对象
        var box = echarts.init(document.querySelector(".box"))
        //4.指定配置项和数据(option)
        var boxOption = {
        title: {
          text: 'ECharts 入门示例'
        },
        tooltip: {},
        legend: {
          data: ['销量']
        },
        xAxis: {
          data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {},
        series: [
          {
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
          }
        ]
      };
      //5.将配置项设置给echarts实例对象
      box.setOption(boxOption);
      //
      
        
    </script>
</body>
</html>